﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

namespace Sbook.Data
{
    public class NewsInfo
    {
        #region[Declare variables]
        private string _nID;
        private string _nTitle;
        private string _nContent;
        private string _nDescription;
        private string _nStatus;
        private string _nDate;
        private string _groupID;
        private string _Image;
        #endregion

        #region[Public Properties]
        public string nID { get { return _nID; } set { _nID = value; } }
        public string nTitle { get { return _nTitle; } set { _nTitle = value; } }
        public string nContent { get { return _nContent; } set { _nContent = value; } }
        public string nDescription { get { return _nDescription; } set { _nDescription = value; } }
        public string nStatus { get { return _nStatus; } set { _nStatus = value; } }
        public string nDate { get { return _nDate; } set { _nDate = value; } }
        public string groupID { get { return _groupID; } set { _groupID = value; } }
        public string Image { get { return _Image; } set { _Image = value; } }
        #endregion

        public NewsInfo NewsIDataReader(IDataReader dr)
        {
            Data.NewsInfo obj = new Data.NewsInfo();
            obj.nID = (dr["NId"] is DBNull) ? string.Empty : dr["NId"].ToString();
            obj.nTitle = (dr["NTitle"] is DBNull) ? string.Empty : dr["NTitle"].ToString();
            obj.nContent = (dr["NContent"] is DBNull) ? string.Empty : dr["NContent"].ToString();
            obj.nDescription = (dr["NDescription"] is DBNull) ? string.Empty : dr["NDescription"].ToString();
            obj.nStatus = (dr["NStatus"] is DBNull) ? string.Empty : dr["NStatus"].ToString();
            obj.nDate = (dr["NDate"] is DBNull) ? string.Empty : dr["NDate"].ToString();
            obj.groupID = (dr["GroupID"] is DBNull) ? string.Empty : dr["GroupID"].ToString();
            obj.Image = (dr["Image"] is DBNull) ? string.Empty : dr["Image"].ToString();
            return obj;
        }
    }
}